package com.adobesamples.controller.command {
  import com.adobesamples.controller.events.ColorChosenEvent;
  import com.adobesamples.state.ModelState;
  import com.adobesamples.state.model;

  public class ChangeColorCommand {
    private var _modelState: ModelState;

    public function ChangeColorCommand(modelState: ModelState) {
      _modelState = modelState;
    }

    public function changeBaseColor(event: ColorChosenEvent): void {
      _modelState.currentConfiguration.model::setBaseColor(event.color);
    }

    public function changeTrimColor(event: ColorChosenEvent): void {
      _modelState.currentConfiguration.model::setTrimColor(event.color);
    }
  }
}